package edu.guet.server.service;

import edu.guet.server.mapper.TestMapper;
import edu.guet.server.model.SemesterStatistic.ChapterScores;
import edu.guet.server.model.Test;
import edu.guet.server.utils.ResultAPI;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TestService {

    @Autowired
    TestMapper testMapper;
    @Autowired
    StuhmkService stuhmkService;

    public ResultAPI demoRequest(Test data) {
        Test t = testMapper.getTest(data);
        return ResultAPI.success(t);
    };

    /**
     * 找到名字，学号，测试成绩
     * @return
     */
    public List<ChapterScores.TestScore> findTestScore(Integer unit_id) {
        return testMapper.findTestScore(unit_id);
    }

    public List<ChapterScores.HomeworkScore> findHmkScore(Integer unitId) {
        return stuhmkService.findHmkScore(unitId);
    }
}